﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HRM.BLL;
using HRM.DAL.DAO;
using HRM.DAL.Report;

namespace HRM.UI.HRAdminUI.Profile
{
    public partial class AdminHome : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            GetEmployeeInfo();
            GetNotice();
        }

    private void GetEmployeeInfo()
        {
            Code code = new Code();
            code.CodeName = Session["Code"].ToString();

            EmployeeManager manager = new EmployeeManager();
            ViewEmployee viewEmployee = new ViewEmployee();
            viewEmployee = manager.SearchEmployeeByCode(code);
            Session["name"] = viewEmployee.Employee.Name;
            //userNameLbl.Text = viewEmployee.Employee.Name;
            empImage.ImageUrl = viewEmployee.Photo.FileName;
            //userDesignation.Text = viewEmployee.Designation.Title;
            //joinDate.Text = (viewEmployee.Employee.JoiningDate).ToShortDateString();
            //empCode.Text = code.CodeName;
        }

    private void GetNotice()
    {
        NoticeManager manager = new NoticeManager();
        int i = 0;
        foreach (DAL.DAO.Notice notice in manager.GetAllNotices())
        {
            if (i == 0)
            {
                NoticeTitle.Text = notice.Subject;
            }
            i++;
        }
    }


    }
}